package com.wyh.controller.feemanagementcontroller;

import com.wyh.common.result.Result;
import com.wyh.domain.dto.feemanagementdto.ConfigurationDTO;
import com.wyh.service.feemanagementservice.ConfigurationService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/config")
@Api(tags = "催收模版")
public class ConfigurationController {
    @Autowired
    public ConfigurationService notification;

    @PostMapping("/selectConfiguration")
    @ApiOperation(value = "查询催收模版")
    public Result<ConfigurationDTO> selectConfiguration() {
        return Result.success(notification.selectConfiguration());
    }

    @PostMapping("/updateConfiguration")
    @ApiOperation(value = "修改催收通知")
    public Result<String> updateConfiguration(@RequestBody ConfigurationDTO configurationDTO) {
        notification.updateConfiguration(configurationDTO);
        return Result.success("修改成功");
    }
}
